package com.hbny.dynamicDataSource.controller;

import com.hbny.dynamicDataSource.DO.TenantDataBaseConfigDO;
import com.hbny.dynamicDataSource.config.AutoSwitchDB;
import com.hbny.dynamicDataSource.service.TenantInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : Aaron
 * @date : 2022/6/2
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private TenantInfoService infoService;

    @AutoSwitchDB
    @GetMapping
    public List<TenantDataBaseConfigDO> test(){
        List<TenantDataBaseConfigDO> result = infoService.getBaseInfoList();
        return result;
    }
}
